import java.io.FileInputStream;
import java.io.ObjectInputStream;

/**
 * 对象反序列化,文件中的数据恢复到本地
 */
public class ObjectInputStreamDemo {
    public static void main(String[] args) throws Exception {
        //创建文件字节输入流管道包装低级的文件字节输入流管道
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("file-io\\src\\obj.txt"));

        //直接调用方法读取
        Student stu1 = (Student) ois.readObject();

        System.out.println(stu1);
    }
}
